package com.yelobblog.yelobblog.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yelobblog.yelobblog.domain.Vo.articlesVo;
import com.yelobblog.yelobblog.domain.entity.articles;

import java.util.List;

public interface articlesService extends IService<articles> {
    void recordViewCount(Integer articleId, String userIp);

    Page<articlesVo> searchArticles(int pageNum, int pageSize, String keyword);

    articlesVo selectById(Integer id);

    Page<articlesVo> selectList(Integer pageNum, Integer pageSize);

    List<articlesVo> selectListByUpdateTime();

    List<articlesVo> selectListByViewCount();

    Page<articlesVo> selectListByCategoryId(Integer pageNum, Integer pageSize, Integer categoryId);

    Page<articlesVo> selectPublicByAuthorId(Integer pageNum, Integer pageSize, Integer authorId);


    Page<articlesVo> selectPrivateByAuthorId(Integer pageNum, Integer pageSize);

    Page<articlesVo> selectDraftByAuthorId(Integer pageNum, Integer pageSize);

    Page<articlesVo> selectDeletedByAuthorId(Integer pageNum, Integer pageSize);

    void insert(String title, String description, Integer categoryId);

    void update(articles articles);

    void deleteById(Integer id);
}
